﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RouterControl.Whs.Wizards;

namespace RouterControl.WhsAddIn.Wizards.SelectRouter
{
    public partial class PageAllowUpload : WizardPageClientBannerTop
    {
        private WizardMain ParentWizardMain
        {
            get { return (WizardMain)this.ParentWizard; }
        }

        public override void StartRealWork()
        {
            base.StartRealWork();

            // gather information
            var info = this.ParentWizardMain.UsageInfo;

            info.ExitPage = GetType().Name;

            // reset values
            this.allowUsageStatsUploadCB.Checked = this.ParentWizardMain.AllowUsageInfoUpload;
        }


        public PageAllowUpload()
        {
            InitializeComponent();
        }

        private void PageAllowUpload_BackButtonClick(object sender, EventArgs e)
        {
            this.SetCurrentPage<PageWelcome>();
        }

        private void PageAllowUpload_OkButtonClick(object sender, EventArgs e)
        {
            // write back
            this.ParentWizardMain.AllowUsageInfoUpload = this.allowUsageStatsUploadCB.Checked;

            // next page
            this.SetCurrentPage<PageSearch>();
        }
    }
}
